import { ProFileType } from '@/store/reducer/user';
import request from '../utils/request';

/**获取用户信息API */
export function getUserInfoAPI() {
  return request({
    url: '/v1_0/user',
  });
}

/** 获取个人资料API */
export function getUserProfileAPI() {
  return request({
    url: '/v1_0/user/profile',
  });
}

/** 更新头像API */
export function updatePhotoAPI(data: FormData) {
  return request({
    url: '/v1_0/user/photo',
    method: 'patch',
    data,
  });
}

/** 编辑用户个人资料API */
export function editProFileAPI(data: Partial<ProFileType>) {
  return request({
    url: '/v1_0/user/profile',
    method: 'patch',
    data,
  });
}
